<?php
/**
 * @author  web_dxj@163.com
 * @time    2015-10-10 14:12
 */

class Categorymeta_model extends CI_Model {

    private $table_name = 'categorymeta';

    public function __construct() {
        parent::__construct();
        $this->load->database();
    }

    public function get_category_metas($category_id) {

        $this->db->where('category_id',$category_id);
        $this->db->select('meta_key , meta_value');
        $query = $this->db->get( $this->table_name );

        if ( 0 >= $query->num_rows() )
        {
            return NULL;
        }

        return $query->result();
    }

}